def assert_register_success(case, expect):
    msg_register_success = case.register.page_get_register_success_inf()
    print(msg_register_success)
    try:
        case.assertIn(expect, msg_register_success)
    except AssertionError:
        return "测试失败"
        # case.register.page_get_screenshot()

def assert_register_password_err(case, expect):
    msg_register_password_err = case.register.page_get_register_password_err_inf()
    print(msg_register_password_err)
    try:
        case.assertEqual(expect, msg_register_password_err)
    except AssertionError:
        return "测试失败"
        # case.register.page_get_screenshot()


def assert_register_verify_code_err(case, expect):
    msg_register_verify_code_err = case.register.page_get_register_verify_code_err_inf()
    print(msg_register_verify_code_err)
    try:
        case.assertEqual(expect, msg_register_verify_code_err)
    except AssertionError:
        return "测试失败"
        # case.register.page_get_screenshot()


def assert_register_phone_code_err(case, expect):
    msg_register_phone_code_err = case.register.page_get_register_phone_code_err_alert()
    print(msg_register_phone_code_err)
    try:
        case.assertEqual(expect, msg_register_phone_code_err)
    except AssertionError:return "测试失败"
        # case.register.page_get_screenshot()

#登录断言
def assert_login_success(case, expect):
    msg_login_success = case.login.page_get_login_success_inf()
    print(msg_login_success)
    try:
        case.assertIn(expect, msg_login_success)
    except AssertionError:
        case.login.page_get_screenshot()
        raise


def assert_login_error(case, expect):
    msg_login_error = case.login.page_get_login_err_inf()
    print(msg_login_error)
    try:
        case.assertIn(expect, msg_login_error)
    except AssertionError:
        case.login.page_get_screenshot()
        raise


